Skip to content

Conversation

PhoenixWhitefire
Copy link

@PhoenixWhitefire PhoenixWhitefire commented Sep 17, 2025

Instead of blanket-disabling inlining for vararg functions, with these changes inlining is evaluated at each call-site instead. Inlining can now succeed if the number of arguments passed to the function is known at compile-time (fixedret). I ran the Unit and Conformance tests and found no issues. For reasons beyond me, the Benchmark just showed "FAILURE" for every test, but these changes shouldn't have any significant regressions.

Additionally, I replaced the vararg inlining failure test with 2 new tests, which validate the two possible code paths for these changes.

Implements: #1696

…ile time

Contains:
Changes to Compiler
+2 tests to replace 1 test
@PhoenixWhitefire
Copy link
Author

PhoenixWhitefire commented Sep 17, 2025

Closing this PR, I need to do some more investigation. I was a little surprised when I made the initial changes and found that everything seemed to just work without changing any of the actual function inlining code, but I guess it really was too good to be true given the failing checks. I thought I ran the full suite locally but I suppose not

@PhoenixWhitefire
Copy link
Author

PhoenixWhitefire commented Sep 17, 2025

I'm not sure whether some of these test failures are false-positives or not. On the Windows action, there was somehow a Type Inference test failing. On the Mac OS action, there's no stacktrace to the call-site of checkerror even though there's supposed to be. The coverage action appears to be the most likely actual oversight by me, but I'm again not sure why none of these failures occurred when I ran Luau.UnitTest and Luau.Conformance locally. Is that not the full suite?

@PhoenixWhitefire PhoenixWhitefire marked this pull request as draft September 17, 2025 14:03
@vegorov-rbx
Copy link
Collaborator

txnlog_checks_for_occurrence_before_self_binding_a_type can be ignored, we have a fix that has been merged yet that will fix that failure.

Don't forget to run conformance in -O2, --codegen -O2 and with fflags=true as well, especially when adding -O2 feature.

@PhoenixWhitefire PhoenixWhitefire changed the title Allow calls to vararg functions to be inlined if the number of arguments are known at compile-time (#1696) Allow calls to vararg functions to be inlined if the number of arguments are known at compile-time Sep 17, 2025
@PhoenixWhitefire
Copy link
Author

Don't forget to run conformance in -O2, --codegen -O2 and with fflags=true as well, especially when adding -O2 feature.

Aha, thanks for pointing that out. I was not aware that I had to do so manually. I can reproduce the failing tests locally now.

Fixes the simplest case of:

---

local function foo(...)
	print(...)
end

foo("Hello, World!")

---

Does not pass tests/Issue snippet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants